home *** CD-ROM | disk | FTP | other *** search
- Path: news.mindlink.net!news
- From: genew@mindlink.bc.ca (Gene Wirchenko)
- Newsgroups: comp.lang.c
- Subject: Re: Count lines in file?
- Date: Wed, 03 Jan 1996 05:32:37 GMT
- Organization: MIND LINK! - British Columbia, Canada
- Message-ID: <4cd4lm$j62@fountain.mindlink.net>
- References: <4bfnqu$btj@news1.netzone.com> <4bi4nr$3qe@castle.nando.net> <4bk30e$l08@news1.netzone.com> <Pine.A32.3.91.951224222853.23094E@red.weeg.uiowa.edu> <4bm9tk$h5a@crl14.crl.com> <820334651snz@genesis.demon.co.uk> <4c4v8b$kb6@crl5.crl.com> <820601750snz@genesis.demon.co.uk>
- NNTP-Posting-Host: line217.nwm.mindlink.net
- X-Newsreader: Forte Free Agent 1.0.82
-
- Lawrence Kirby <fred@genesis.demon.co.uk> wrote:
-
- [Attack of the giant scissors]
-
- >>Oh, before someone else points it out: One problem with getc might be if
- >>the last line of the program doesn't have a terminating newline
- >>character, i.e. it terminates with the eof. This could cause the count
- >>to be off by one in such cases.
-
- >It depends on your definition of a 'line'. It is reasonable to say is that
- >of the final sequence of characters is not terminated by '\n' it is not
- >a valid line.
-
- [snip]
-
- You'd run into trouble on a UNIX system where the final line ends
- with the end of file. (In my limited experience: UNIX experts, if I'm
- wrong, just smile to yourself and read on.)
-
- Come on, Mr. Kirby!
-
- It depends on your definition of a "line". It is reasonable to
- say that if <implementation defined condition>, it is not a line.
-
- Sincerely,
-
- Gene Wirchenko
-
- C Pronunciation Guide:
- y=x++; "wye equals ex plus plus semicolon"
- x=x++; "ex equals ex doublecross semicolon"
-
-